
from pom.basedriver import BaseDriver

class CreateTopic(BaseDriver):

    def new_topic(self,tab,title,content):
        self.driver.find_element_by_id('org.cnodejs.android.md:id/spn_tab').click()
        self.driver.find_element_by_android_uiautomator(self.android_uiautomator+f'text("{tab}").className("android.widget.CheckedTextView")').click()

        self.driver.find_element_by_id('org.cnodejs.android.md:id/edt_title').send_keys(title)
        self.driver.find_element_by_id('org.cnodejs.android.md:id/edt_content').send_keys(content)

        self.driver.find_element_by_id('org.cnodejs.android.md:id/action_send').click()